<?php
	session_start(); //开启session
	if(!isset($_SESSION['users'])){
		header('location:./loginA.php');exit;
	}

	// 加载公共文件
	include_once('../public/config/config.php');
	include_once('../public/config/sql.php');

	// 实例化对象
	$obj = new sql($info);

	// 构建SQL语句
	$sql = "select id,`name`,`key`,`describe` from siteInformation";
	$rows = $obj->db_select($sql, false);
?>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="keywords" content="<?php echo $rows['key'];?>">
	<meta http-equiv="describe" content="<?php echo $rows['describe'];?>">
	<title><?php echo $rows['name'];?>&nbsp-&nbsp后台管理系统</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="./public/iconfont/iconfont.css">
	<link rel="stylesheet" type="text/css" href="./public/css/UI.css">
	<link rel="stylesheet" type="text/css" href="./public/css/base.css">
	<link rel="stylesheet" type="text/css" href="./public/css/header.css">
	<link rel="stylesheet" type="text/css" href="./public/css/iframeOne.css">
	<link rel="stylesheet" type="text/css" href="./public/css/iframeTwo.css">
	<link rel="stylesheet" type="text/css" href="./public/css/middle.css">
	<script src="./public/js/jquery.js" type="text/javascript"></script>
	<script src="./public/js/parsingMethod.js" type="text/javascript"></script>
	<script src="./public/js/ajax.js" type="text/javascript"></script>
	<script src="./public/js/check.js" type="text/javascript"></script>
	<script src="./public/js/iframeOne.js" type="text/javascript"></script>
	<script src="./public/js/UI.js" type="text/javascript"></script>
</head>
<body>
	<header class="myheader">
		<div class="headerCenter">
			<div class="middle_list clearBoth">
				<div class="module_l"><span><?php echo $rows['name']?>&nbsp-&nbsp</span></div>

				<div class="module_r">
					<a href="">系统首页</a>
					<a href="./pose/logoutAction.php">安全退出</a>
				</div>
			</div>
		</div>
	</header>

	<!-- nav 导航模块 -->
	<nav class="mynav">
		<div class="nav_title">
			<div class="nav_title_middle">
				<span>Admin</span>
				<p>欢迎您访问我们的后台</p>
			</div>
		</div>

		<ul id="middle_box" class="middle_box">
			<li class="nav_list">
				<a class="title" href="#"><i class="iconfont icon-shouye3"></i>系统管理</a>
				<ul>
					<li><a href="./index.php?param=middle">系统首页</a></li>
					<li><a href="./index.php?param=siteInformation">站点信息</a></li>
					<li><a href="./index.php?param=notice">公告列表</a></li>
				</ul>
			</li>
			<li class="nav_list">
				<a class="title" href="#"><i class="iconfont icon-xiugai"></i>站点管理</a>
				<ul>
					<li><a href="./index.php?param=menu_list">菜单列表</a></li>
					<li><a href="./index.php?param=slide_list">轮播列表</a></li>
				</ul>
			</li>
			<li class="nav_list">
				<a class="title" href="#"><i class="iconfont icon-fenlei "></i>分类管理</a>
				<ul>
					<li><a href="./index.php?param=article_classify">文章分类</a></li>
				</ul>
			</li>
			<li class="nav_list">
				<a class="title" href="#"><i class="iconfont 
				icon-weibiaoti1"></i>文章管理</a>
				<ul>
					<li><a href="./index.php?param=article_lists">文章列表</a></li>
				</ul>
			</li>
			<li class="nav_list">
				<a class="title" href="javascript:;"><i class="iconfont icon-guanliyuan3"></i>人群管理</a>
				<ul>
					<li><a href="./index.php?param=users_list">用户列表</a></li>
					<li><a href="./index.php?param=administrator_list">管理员列表</a></li>
				</ul>
			</li>
		</ul>
	</nav>
</body>
</html>
<script type="text/javascript">	
	var middle_box  =   document.getElementById('middle_box'),
		title       =   middle_box.getElementsByClassName('title'),
		ul          =   middle_box.getElementsByTagName('ul');
	
	for(var i  = 0; i < title.length; i++){
		title[i].index = i; // 获取索引
		ul[i].style.display = "none";
		title[i].onclick = function(){
			var rest = PARSING.otherIndex({"element":ul, "index":this.index});

			for(var i = 0; i < ul.length; i++){

				ul[i].className = "";
			}

			if(ul[this.index].style.display == "none"){

				ul[this.index].style.display = "block";

				for(var i = 0; i < rest.length; i++){
			
					ul[rest[i]].style.display = "none";
				}
			}else{

				ul[this.index].style.display = "none";
			}
			
		}
	}
</script>
